package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
    public static void main(String[] args) {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication app = new SpringApplication(RuoYiApplication.class);
        Environment env = app.run(args).getEnvironment();
        try {
            String ipAddress = InetAddress.getLocalHost().getHostAddress();
            String port = env.getProperty("server.port");
            String contextPath = env.getProperty("server.servlet.context-path");
            System.out.println("swagger地址(doc.html): http://" + ipAddress + ":" + port + contextPath + "/doc.html");
            System.out.println("swagger地址(swagge-ui.html): http://" + ipAddress + ":" + port + contextPath + "/swagger-ui/index.html");
        } catch (UnknownHostException e) {
            System.err.println("获取本机地址失败 " + e);
        }
        System.out.println("(♥◠‿◠)ﾉﾞ  若依MybatisPlus版启动成功   ლ(´ڡ`ლ)ﾞ ");

    }
}
